Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List select function #893

Merged
merged 2 commits into from
Dec 31, 2023

Conversation

norberttech
Copy link
Member

Change Log

Added

  • list select function

Fixed

Changed

Removed

Deprecated

Security


Description

The goal is to allow narrowing properties in list of structures.

Usage:

        df()
            ->read(
                from_array([
                    ['list' => [['id' => 1, 'name' => 'test'], ['id' => 2, 'name' => 'test2'], ['id' => 3, 'name' => 'test3']]],
                    ['list' => [['id' => 4, 'name' => 'test4'], ['id' => 5, 'name' => 'test5'], ['id' => 6, 'name' => 'test6']]],
                ])
            )
            ->withEntry('list', list_ref('list')->select('id'))

Copy link
Contributor

github-actions bot commented Dec 31, 2023

Flow PHP - Benchmarks

Results of the benchmarks from this PR are compared with the results from 1.x branch.

Extractors
+-----------------------+-------------------+------+-----+------------------+------------------+----------------+
| benchmark             | subject           | revs | its | mem_peak         | mode             | rstdev         |
+-----------------------+-------------------+------+-----+------------------+------------------+----------------+
| AvroExtractorBench    | bench_extract_10k | 1    | 3   | 35.152mb +0.00%  | 763.397ms +0.48% | ±0.60% +6.57%  |
| CSVExtractorBench     | bench_extract_10k | 1    | 3   | 4.805mb +0.03%   | 344.631ms -6.32% | ±1.77% -44.21% |
| JsonExtractorBench    | bench_extract_10k | 1    | 3   | 4.903mb +0.03%   | 983.035ms -0.01% | ±0.34% -23.14% |
| ParquetExtractorBench | bench_extract_10k | 1    | 3   | 239.609mb +0.00% | 1.139s +0.09%    | ±0.39% -48.42% |
| TextExtractorBench    | bench_extract_10k | 1    | 3   | 4.671mb +0.03%   | 56.512ms -0.22%  | ±0.31% -20.04% |
| XmlExtractorBench     | bench_extract_10k | 1    | 3   | 4.673mb +0.03%   | 469.783ms +0.37% | ±0.51% -81.95% |
+-----------------------+-------------------+------+-----+------------------+------------------+----------------+
Transformers
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
| benchmark                   | subject                  | revs | its | mem_peak         | mode            | rstdev         |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
| RenameEntryTransformerBench | bench_transform_10k_rows | 1    | 3   | 110.395mb +0.00% | 63.521ms +1.63% | ±0.49% -13.04% |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
Loaders
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| benchmark          | subject        | revs | its | mem_peak         | mode             | rstdev          |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| AvroLoaderBench    | bench_load_10k | 1    | 3   | 94.767mb +0.00%  | 454.147ms -1.02% | ±0.51% -68.40%  |
| CSVLoaderBench     | bench_load_10k | 1    | 3   | 54.845mb +0.00%  | 72.542ms -2.61%  | ±2.71% +168.60% |
| JsonLoaderBench    | bench_load_10k | 1    | 3   | 105.361mb +0.06% | 56.485ms -1.15%  | ±0.33% -50.28%  |
| ParquetLoaderBench | bench_load_10k | 1    | 3   | 320.571mb +0.00% | 1.252s -0.44%    | ±0.17% -85.10%  |
| TextLoaderBench    | bench_load_10k | 1    | 3   | 17.722mb +0.01%  | 41.016ms -0.17%  | ±0.28% -36.93%  |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
Building Blocks
+-------------------------+----------------------------+------+-----+------------------+------------------+-----------------+
| benchmark               | subject                    | revs | its | mem_peak         | mode             | rstdev          |
+-------------------------+----------------------------+------+-----+------------------+------------------+-----------------+
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 116.015mb +0.00% | 387.711ms -1.55% | ±0.71% -65.32%  |
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 59.733mb +0.00%  | 200.330ms -0.82% | ±1.10% +5.51%   |
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 14.858mb +0.01%  | 40.553ms -1.73%  | ±1.98% +129.99% |
| TypeDetectorBench       | bench_type_detector        | 1    | 3   | 59.406mb +0.00%  | 335.694ms +0.65% | ±2.77% +264.59% |
| TypeDetectorBench       | bench_type_detector        | 1    | 3   | 14.329mb +0.01%  | 65.393ms -0.25%  | ±0.91% +856.94% |
| RowsBench               | bench_chunk_10_on_10k      | 2    | 3   | 76.472mb +0.00%  | 3.736ms -6.16%   | ±1.28% +117.18% |
| RowsBench               | bench_diff_left_1k_on_10k  | 2    | 3   | 96.266mb +0.00%  | 178.668ms -2.34% | ±0.42% -61.46%  |
| RowsBench               | bench_diff_right_1k_on_10k | 2    | 3   | 74.791mb +0.00%  | 18.203ms -1.91%  | ±0.34% -75.57%  |
| RowsBench               | bench_drop_1k_on_10k       | 2    | 3   | 77.712mb +0.00%  | 1.697ms +1.89%   | ±2.12% +32.08%  |
| RowsBench               | bench_drop_right_1k_on_10k | 2    | 3   | 77.712mb +0.00%  | 1.679ms -5.84%   | ±0.71% -1.66%   |
| RowsBench               | bench_entries_on_10k       | 2    | 3   | 74.824mb +0.00%  | 2.583ms -11.24%  | ±1.14% -3.16%   |
| RowsBench               | bench_filter_on_10k        | 2    | 3   | 75.353mb +0.00%  | 14.956ms +1.78%  | ±1.81% +87.60%  |
| RowsBench               | bench_find_on_10k          | 2    | 3   | 75.353mb +0.00%  | 14.799ms +0.87%  | ±1.82% +7.65%   |
| RowsBench               | bench_find_one_on_10k      | 10   | 3   | 73.256mb +0.00%  | 1.800μs 0.00%    | ±0.00% 0.00%    |
| RowsBench               | bench_first_on_10k         | 10   | 3   | 73.256mb +0.00%  | 0.400μs 0.00%    | ±0.00% 0.00%    |
| RowsBench               | bench_flat_map_on_1k       | 2    | 3   | 86.878mb +0.00%  | 13.088ms -1.17%  | ±1.52% +202.20% |
| RowsBench               | bench_map_on_10k           | 2    | 3   | 116.172mb +0.06% | 62.627ms +0.54%  | ±0.35% -52.58%  |
| RowsBench               | bench_merge_1k_on_10k      | 2    | 3   | 75.873mb +0.00%  | 1.187ms -16.61%  | ±1.05% -13.97%  |
| RowsBench               | bench_partition_by_on_10k  | 2    | 3   | 78.148mb +0.00%  | 36.996ms -1.88%  | ±1.01% +33.00%  |
| RowsBench               | bench_remove_on_10k        | 2    | 3   | 77.974mb +0.00%  | 3.930ms +2.46%   | ±2.20% +213.15% |
| RowsBench               | bench_sort_asc_on_1k       | 2    | 3   | 73.402mb +0.00%  | 39.698ms -1.90%  | ±1.19% -24.28%  |
| RowsBench               | bench_sort_by_on_1k        | 2    | 3   | 73.403mb +0.00%  | 39.904ms -1.16%  | ±0.20% -77.00%  |
| RowsBench               | bench_sort_desc_on_1k      | 2    | 3   | 73.402mb +0.00%  | 40.182ms -1.79%  | ±0.47% -52.83%  |
| RowsBench               | bench_sort_entries_on_1k   | 2    | 3   | 75.698mb +0.00%  | 7.492ms +1.64%   | ±1.03% -39.47%  |
| RowsBench               | bench_sort_on_1k           | 2    | 3   | 73.256mb +0.00%  | 29.080ms -0.48%  | ±0.59% +13.31%  |
| RowsBench               | bench_take_1k_on_10k       | 10   | 3   | 73.256mb +0.00%  | 13.500μs +0.84%  | ±1.21% -37.63%  |
| RowsBench               | bench_take_right_1k_on_10k | 10   | 3   | 73.256mb +0.00%  | 16.088μs +0.40%  | ±0.59% -49.69%  |
| RowsBench               | bench_unique_on_1k         | 2    | 3   | 96.267mb +0.00%  | 186.029ms -1.36% | ±1.61% -11.00%  |
+-------------------------+----------------------------+------+-----+------------------+------------------+-----------------+

@github-actions github-actions bot added size: M and removed size: S labels Dec 31, 2023
@norberttech norberttech merged commit a09e99f into flow-php:1.x Dec 31, 2023
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant